-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue1100 #1320
issue1100 #1320
Conversation
Block config: ``` { "_id": "b-05", "_parentId": "a-05", "_type": "block", "_classes": "animated", "title": "b-05", "displayTitle": "", "body": "", "_trackingId": 0, "_onScreen": { "_isEnabled": true, "_classes": "wobble", "_percentInviewVertical": 50 } } ``` Disabled by default.
setupOnScreenHandler: function() { | ||
var onscreen = this.model.get('_onScreen'); | ||
|
||
if (onscreen && onscreen._isEnabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind terribly reversing the logic here so we can sink the indentation?
if (!onscreen || !onscreen._isEnabled) return;
…ed for every article/block/component
1a5e9dd
to
9316b69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm worried the off("onscreen")
will break anything else that is listening, i suggest we namespace the event with onscreen.adaptView
|
||
if (!onscreen || !onscreen._isEnabled) return; | ||
|
||
this.$el.on('onscreen', _.bind(function (e, m) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change this to this.$el('onscreen.adaptView'
?
|
||
if (m.percentInviewVertical < minVerticalInview) return; | ||
|
||
this.$el.addClass( onscreen._classes || 'onscreen' ).off('onscreen'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change this to .off('onscreen.adaptView');
?
@@ -93,6 +112,7 @@ define([ | |||
}, | |||
|
|||
remove: function() { | |||
this.$el.off('onscreen'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change this to .off('onscreen.adaptView')
?
Update blockView to add css class if element is onScreen.
Block config:
Disabled by default.
The block config shows example using animate.css animtions.